﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link href="../Script/jquery-easyui/themes/default/easyui.css" rel="stylesheet" type="text/css" />
    <link href="../Script/jquery-easyui/themes/icon.css" rel="stylesheet" type="text/css" />
    <!--<script src="../Script/jquery-1.6.1.js" type="text/javascript"></script>-->
    <script src="../Script/jquery-1.8.2.min.js" type="text/javascript"></script>
    <script src="../Script/jquery-easyui/jquery.easyui.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {

            //自定义数据

            $("#tt2").datagrid({
                columns: [[{ field: 'code', title: 'Code' }, { field: 'name', title: 'Name'}]]
            });

            var b = { "total": 100, "rows": [{ "code": "1", "name": "一" }, { "code": "2", "name": "二"}] };

            $("#tt2").datagrid('loadData', b); //加载数据


        });



        function getRemoteLog() {
            //自定义数据

            $("#dg").datagrid({
                columns: [[{ field: 'code', title: 'Code' }, { field: 'name', title: 'Name'}]]
            });

            var b = { "total": 100, "rows": [{ "code": "1", "name": "一" }, { "code": "2", "name": "二"}] };

            $("#dg").datagrid('loadData', b); //加载数据


        }

        function getRemoteLog1() {
            var products = {
                "total": 239,
                "rows": [
		                    { "code": "001", "name": "Name 1", "addr": "Address 11", "col4": "col4 data" },
		                    { "code": "002", "name": "Name 2", "addr": "Address 13", "col4": "col4 data" },
		                    { "code": "003", "name": "Name 3", "addr": "Address 87", "col4": "col4 data" },
		                    { "code": "004", "name": "Name 4", "addr": "Address 63", "col4": "col4 data" },
		                    { "code": "005", "name": "Name 5", "addr": "Address 45", "col4": "col4 data" },
		                    { "code": "006", "name": "Name 6", "addr": "Address 16", "col4": "col4 data" },
		                    { "code": "007", "name": "Name 7", "addr": "Address 27", "col4": "col4 data" },
		                    { "code": "008", "name": "Name 8", "addr": "Address 81", "col4": "col4 data" },
		                    { "code": "009", "name": "Name 9", "addr": "Address 69", "col4": "col4 data" },
		                    { "code": "010", "name": "Name 10", "addr": "Address 78", "col4": "col4 data" }
	                    ]
            };
            $("#dg").datagrid(
      {
          columns: [[
					{ field: 'code', title: 'id', width: 120, align: 'left', sortable: true },
					{ field: 'name', title: 'name', width: 120, align: 'right', sortable: true },

				]]
      });
            $('#dg').datagrid('loadData', products);
        }


    </script>
</head>
<body>
    <table id="tt">
    </table>
    <table id="tt2">
    </table>
    <table id="dg">
    </table>
    <input type="button" onclick="getRemoteLog()" value="Call" />
    <a href="#" class="easyui-linkbutton" iconcls="icon-class" id="btn-remote-log" onclick="javascript:getRemoteLog1();return false;">
        读远程日志</a>
</body>
</html>
